#include <TestComponent.h>
#include <ALEstd.h>

bool TestComponent::VInit(tinyxml2::XMLElement* pData)
{
	tinyxml2::XMLElement* pCounterElement = pData->FirstChildElement("Test");
	if(pCounterElement)
	{
		m_counter = 0;
		pCounterElement->QueryDoubleAttribute("counter", &m_counter);
	}
	return true;
}

void TestComponent::VUpdate(double deltaSecs)
{
	m_counter = deltaSecs;
}

const char* TestComponent::g_name = "TestComponent";
const ComponentId& TestComponent::g_ID = ActorComponent::GetIdFromName(TestComponent::g_name);

ActorComponent* CreateTestComponent()
{
	return ALE_NEW TestComponent();
}